package com.fang.chain;

import com.fang.chain.config.LevelConfig;

import java.math.BigDecimal;

/**
 * @author fanglingxiao
 * @version 1.0
 * @description 责任链模式test
 * @date 2022/4/24 1:35 下午
 **/
public class TestChain {

    public static void main(String[] args) {
        DirectorAuditHandler director = new DirectorAuditHandler(null, LevelConfig.DIRECTOR_LEVEL);
        ManagerAuditHandler manager = new ManagerAuditHandler(director, LevelConfig.MANAGER_LEVEL);
        CustomerAuditHandler customer = new CustomerAuditHandler(manager, LevelConfig.CUSTOMER_LEVEL);

        HandleRequest request = new HandleRequest();
        request.setHandleLevel(customer.calcLevel(new BigDecimal("1000")));
        HandleResponse<String> response = customer.executor(request);
    }
}
